package com.gxa.usermanagement.controller;

import com.gxa.common.R;
import com.gxa.common.entity.usermange.Distribution;
import com.gxa.usermanagement.service.DistributionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Distribution")
public class DistributionController {

    @Autowired
    private DistributionService distributionService;

    //@PostMapping("/add")
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public R addDistributionController( Distribution distribution){
        System.out.println(distribution);
        return distributionService.addDistributionService(distribution);
    }

    @PostMapping("/findById")
    public R findDistributionByIdController(Integer id){

        return distributionService.findDistributionByIdService(id);
    }

    @PostMapping("/findAll")
    public R findDistributionAllController(Integer currentPage,Integer pageSize){

        return distributionService.findDistributionAllService(currentPage,pageSize);
    }
}
